package com.jumi.microservice.service.usercash.api;

import com.jumi.microservice.mapper.CpsUserCashMapper;
import com.jumi.microservice.service.ICpsUserCashDubboService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author scw
 * @date 2021/1/9
 */
@DubboService
public class CpsUserCashDubboServiceImpl implements ICpsUserCashDubboService {
    @Resource
    private CpsUserCashMapper userCashMapper;

    /**
     * 本月提现金额总额
     *
     * @param uid
     * @return
     */
    @Override
    public BigDecimal getTotalAmountByMonth(Long uid) {
        BigDecimal totalAmount = userCashMapper.getTotalAmountByMonth(uid);
        return totalAmount == null ? BigDecimal.ZERO : totalAmount;
    }
}
